<template>
  <el-table
      :data="tableData"
      style="width: 100%">
    <el-table-column
        type="selection"
        width="55">
    </el-table-column>
    <el-table-column
        prop="id"
        label="角色编号"
        width="120">
    </el-table-column>
    <el-table-column
        prop="name"
        label="角色名称"
        width="120">
    </el-table-column>
    <el-table-column
        prop="permission"
        label="数据权限"
        show-overflow-tooltip>
    </el-table-column>
    <el-table-column
        prop="createTime"
        label="创建时间"
        show-overflow-tooltip>
    </el-table-column>

    <el-table-column label="操作" width="200" align="center">
      <template #default="{ row }">
        <el-link type="danger" @click="handleDelete(row)">删除</el-link>
        <el-divider direction="vertical" />
        <el-link type="success" @click="handleEdit(row)">编辑</el-link>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
import axios from '@/utils/request';
export default {
  data() {
    return {
      tableData: [{
        id:1,
        createTime: '2016-05-02',
        name: '超级管理员',
        permission: '全部数据权限'
      }, {
        id:2,
        createTime: '2016-05-04',
        name: '普通角色',
        permission: '仅本人数据权限'
      }]
    }
  },
  methods: {
    handleEdit(row) {
      console.log(row);
    },
    handleDelete(row) {
      console.log(row);
    }
  }
}
</script>
